/**
 * 通过interface自定义了一种数据格式
 */
interface IStu {
    id:number,
    name:string,
    classes:string,
    address?:string
}

let students:Array<IStu> = [
    {id:1,name:"xiaowang",classes:"web33",address:""},
    {id:2,name:"xiaofei",classes:"web33"}
]

for (const item of students) {
    //在编译器中有些时候，报错
    console.log(item.address);
}
// let students2:IStu[] = [
//     {id:1,name:"xiaowang",classes:"web33"},
//     {id:2,name:"xiaofei",classes:"web33"}
// ]


let stu:IStu = {id:1,name:"xiaowang",classes:"web33"}

function call(stu:IStu){

}

export {}

